Copyright ã1995 by NeXT Computer, Inc.  All Rights Reserved.

DBEditableFormatter

Inherits From:	DBFormatter : Object

Declared In:	dbkit/DBEditableFormatter.h

Class Description

DBEditableFormatter is one of three subclasses of DBFormatter that support the display and editing of data in DBTableView.  The others are DBTextFormatter and DBImageFormatter.  DBEditableFormatter supports user revisions of the displayed data.  Although DBTextFormatter is capable of faster character-based display, it's limited to read-only use.  See the description of the superclass, DBFormatter.

Instance Variables

id	font;

id	editView;

id	drawCell;

font	The current font

editView	The view now being edited

drawCell	The TextField cell that's being edited

Method Types

Initializing	- init
- free

Manipulating the font	- font
- setFont:

Displaying and editing	- drawFieldAt::inside:inView:withAttributes::
usePositions::
- editFieldAt::inside:inView:withAttributes::
usePositions::onEvent:
- abortEditing
- endEditing

Archiving	- write:
- read:
- finishUnarchiving

Instance Methods

abortEditing

- abortEditing

Forces an end to the current editing (if any), discarding any changes the user may have made.  Returns self.

drawFieldAt::inside:inView:withAttributes::usePositions::

- drawFieldAt:(unsigned int) row
:(unsigned int)column 
inside:(NXRect *)frame 
inView:aView
withAttributes:(id <DBTableVectors>) rowAttrs 
:(id <DBTableVectors>) columnAttrs
usePositions:useRowPos
:(BOOL)useColumnPos

Draws one field of data.  You never invoke this method directly; it's invoked automatically by the DBTableView that's using this DBEditableFormatter when a field needs to be displayed.

editFieldAt::inside:inView:withAttributes::usePositions::onEvent:

- (BOOL)editFieldAt:(unsigned int)row
:column 
inside:(NXRect *)frame 
inView:view
withAttributes:(<DBTableVectors>)rowAttrs
:(<DBTableVectors>)columnAttrs
usePositions:(BOOL)useRowPos
:(BOOL)useColumnPos
onEvent:theEvent

Prepares the DBEditableFormatter for editing.  You never invoke this method directly; it's invoked when the user acts on the DBTableView.

endEditing

- (BOOL)endEditing

Invoked to terminate editing in the current field, usually when the user clicks in a different field (thereby indicating that editing in this one is complete).  Returns YES if successful (this, if the method is able to make the window that sent the message the first responder).

finishUnarchiving

- finishUnarchiving

Invoked after a DBEditableFormatter's instance variables have been unarchived (using read:) as a final step in initialization.  Your application should not need to invoke this method explicitly.  Returns self.

font

- font

Returns the DBEditableFormatter's Font object.

free

- free

Frees the DBEditableFormatter instance..

init

- init

Initializes the DBTextFormatter instance.  In the course of initializing, the display font is set to the user's default font at 12.0 point.  Returns self.

read:

- read:(NXTypedStream *) stream

Restores the values of the object's instance variables from the archive stream, including its font and delegate.  Returns self.

setFont:

- setFont:aFont

Sets the current font to the Font object aFont.  Returns self.

write:

- write:(NXTypedStream *) stream

Writes the DBTextFormatter's instance variables to stream, including its font and its delegate.

Closes the connection to the database by sending it the command aString.  The DBDatabase object then loads the default data dictionary.  Returns YES if the connection was successfully closed. 

See also:  disconnect